//
//  LRXHistroyHelpItemModel.m
//  路人侠
//
//  Created by zhangxulong on 6/1/16.
//  Copyright © 2016 zhangxulong. All rights reserved.
//

#import "LRXHistroyHelpItemModel.h"
#import "LRXThing.h"

@implementation LRXHistroyHelpItemModel
- (instancetype)initHistroyHelpWithDic:(NSDictionary *)dic
{
    if (self = [super init]) {
        self.additional_pay = dic[@"additional_pay"];
        self.total_price = dic[@"total_price"];
        self.updated_at = dic[@"updated_at"];
        
        NSMutableArray * thingArray = [NSMutableArray array];
        for(NSDictionary * thing in dic[@"waiter_request"][@"content"]){
            [thingArray addObject:[LRXThing thingWith:thing]];
        }
        self.thingArray = thingArray;
        
        self.created_at = dic[@"waiter_request"][@"created_at"];
        self.itemID = dic[@"waiter_request"][@"id"];
        self.is_home_delivery = dic[@"waiter_request"][@"is_home_delivery"];
        self.remark = dic[@"waiter_request"][@"remark"];
        self.req_end_time = dic[@"waiter_request"][@"req_end_time"];
        self.req_start_time = dic[@"waiter_request"][@"req_start_time"];
        self.status = dic[@"waiter_request"][@"status"];
        self.tips = dic[@"waiter_request"][@"tips"];
        self.profile_url = dic[@"waiter_request"][@"user"][@"profile_url"];
        self.sexy = dic[@"waiter_request"][@"user"][@"sexy"];
    }
    return self;
}
+ (instancetype)histroyHelpWithDic:(NSDictionary *)dic
{
    return [[LRXHistroyHelpItemModel alloc]initHistroyHelpWithDic:dic];
}
@end
